package com.jackstraw.jack_base.mq.rocketmq.consumer;

import com.jackstraw.jack_base.mq.rocketmq.aspect.annotation.RocketMQMessageListener;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;

import java.io.UnsupportedEncodingException;

/**
 * 延时消息消息消费者
 */
@Slf4j
@RocketMQMessageListener(topic = "syncDelayLevelTopic", consumerGroup = "syncDelayLevelGroup")
public class SyncDelayLevelTopicConsumer extends AbstractRocketMQListener {


    @Override
    public void message(MessageExt message) {
        String str = null;
        try {
            str = new String(message.getBody(), "utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        log.info("Class:SyncDelayLevelTopicConsumer,Group：demo，Topic：syncDelayLevelTopic ， 消息体：{}",str);
    }

}